<template>
  <div class="user_outer">
    <div class="user_container">
      <div class="breadcrumbs">
        <a href="/">首页</a>
        <span class="sep">/</span>
        <span>{{ title }}</span>
      </div>
      <div class="row clearfix">
        <div class="span4">
          <div class="user-menu">
            <div class="menu-box">
              <h3 class="title">订单中心</h3>
              <ul class="list">
                <li>
                  <router-link to="/user/orderList">我的订单</router-link>
                </li>
              </ul>
            </div>
            <div class="menu-box">
              <h3 class="title">个人中心</h3>
              <ul class="list">
                <li>
                  <router-link to="/user/portal">我的个人中心</router-link>
                </li>
                <li>
                  <router-link to="/user/address">收货地址</router-link>
                </li>
                <li>
                  <router-link to="/user/message">消息通知</router-link>
                </li>
              </ul>
            </div>
            <div class="menu-box">
              <h3 class="title">账户管理</h3>
              <ul class="list">
                <li>
                  <router-link to="/user/account">个人信息</router-link>
                </li>
              </ul>
            </div>
          </div>
        </div>
        <div class="span16">
          <div class="main-box">
            <router-view></router-view>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()

const title = computed(() => {
  let title: string = ''
  switch (route.name) {
    case 'orderList':
      title = '订单中心'
      break
    case 'portal':
      title = '个人中心'
      break
    case 'address':
      title = '地址中心'
      break
    case 'account':
      title = '账户中心'
      break
    case 'message':
      title = '消息中心'
      break
  }
  return title
})
</script>

<style lang="less" scoped>
.router-link-active {
  color: #ff6900 !important;
}
.user_outer {
  background-color: #f5f5f5;
  padding-bottom: 40px;
  .user_container {
    width: 1226px;
    margin: 0 auto;
    .breadcrumbs {
      height: 40px;
      font-size: 12px;
      line-height: 40px;
      background: #f5f5f5;
      color: #757575;
      > a {
        color: #757575;
      }
      > .sep {
        margin: 0 0.5em;
        color: #b0b0b0;
      }
    }
    .row {
      margin-left: -14px;
      > .span4 {
        width: 234px;
        float: left;
        margin-left: 14px;
        min-height: 1px;
        > .user-menu {
          background: #fff;
          padding: 36px 0;
          > .menu-box {
            margin: 0 48px 12px;
            > .title {
              font-size: 16px;
              font-weight: 400;
              line-height: 52px;
              color: #333;
              margin: 0;
              padding: 0;
            }
            > .list {
              > li {
                padding: 6px 0;
                > a {
                  color: #757575;
                }
              }
            }
          }
        }
      }
      > .span16 {
        width: 978px;
        float: left;
        margin-left: 14px;
        min-height: 1px;
        > .main-box {
          padding: 36px 48px;
          background: #fff;
        }
      }
    }
  }
}
</style>
